export const actionTypes = {
    SETUSERTOKEN: 'SETUSERTOKEN',  //存储登录的token
    SETMAP: 'SETMAP', //存储经纬度
    TYPEDATA: 'TYPEDATA',
    GETCLASSDATE: 'GETCLASSDATE', //默认时间
    SEARCHTITLE: 'SEARCHTITLE', //搜索内容
    REGIONID: 'REGIONID', //省区域id
    AREAID: 'AREAID', //市区域id 用于切换城市
    ONEADCODESCODE: 'ONEADCODESCODE',
    ONEADCODESNAME: 'ONEADCODESNAME',
    ADCODESCODE: 'ADCODESCODE', //区域编码 用于切换城市
    ADCODESNAME: 'ADCODESNAME', //区域 城市  名称
    BACKPAGE: 'BACKPAGE', //发布返回上一级做判断
    GAINCOURSE: 'GAINCOURSE', //发布选择课程存储
    SETPEOPLE: 'SETPEOPLE', //新人优惠券弹窗 状态判断
    MOBILEFLAG: 'MOBILEFLAG', //判断是否授权手机号 0未授权 1授权
    EXISUSER: 'EXISUSER', //判断是否授权用户信息 0未授权 1授权
};

export const actionCreator = {
    setUserToken:res => {
        return {
            type: actionTypes.SETUSERTOKEN,
            payload: {
                userToken: res
            }
        }
    },
    setMap: res => {
        return {
            type: actionTypes.SETMAP,
            payload: {
                map: res
            }
        }
    },
    typeData: res => {
        return {
            type: actionTypes.TYPEDATA,
            payload: {
                getData: res
            }
        }
    },
    getClassDate: res => {
        return {
            type: actionTypes.GETCLASSDATE,
            payload: {
                setClassDate: res
            }
        }
    },
    getSearchTitle: res => {
        return {
            type: actionTypes.SEARCHTITLE,
            payload: {
                searchTitle: res
            }
        }
    },
    getRegionId: res => {
        return {
            type: actionTypes.REGIONID,
            payload: {
                regionIds: res
            }
        }
    },
    getAreaId: res => {
        return {
            type: actionTypes.AREAID,
            payload: {
                areaIds: res
            }
        }
    },
    getnOneAdcodeCode: res => {
        return {
            type: actionTypes.ONEADCODESCODE,
            payload: {
                oneAdcodeCode: res
            }
        }
    },
    getOneAdcodeName: res => {
        return {
            type: actionTypes.ONEADCODESNAME,
            payload: {
                oneAdcodeName: res
            }
        }
    },
    getAdcodeCode: res => {
        return {
            type: actionTypes.ADCODESCODE,
            payload: {
                adcodeCode: res
            }
        }
    },
    getAdcodeName: res => {
        return {
            type: actionTypes.ADCODESNAME,
            payload: {
                adcodeName: res
            }
        }
    },
    getbackPage: res => {
        return {
            type: actionTypes.BACKPAGE,
            payload: {
                backPage: res
            }
        }
    },
    getGainCourse: res => {
        return {
            type: actionTypes.GAINCOURSE,
            payload: {
                gainCourse: res
            }
        }
    },
    setPeople: res => {
        return {
            type: actionTypes.SETPEOPLE,
            payload: {
                peopleStatus: res
            }
        }
    },
    setMobileFlag: res => {
        return {
            type: actionTypes.MOBILEFLAG,
            payload: {
                mobileFlag: res
            }
        }
    },
    setExistUser: res => {
        return {
            type: actionTypes.EXISUSER,
            payload: {
                existUser: res
            }
        }
    },
};
